home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 27 / CDROM27.iso / share / progra / mai / Internet, Returning host name from WinSock < prev    next >
Encoding:
Text File  |  1997-07-31  |  670 b   |  17 lines

  1. 'Description: Asynchronous routine which returns the true host name given
  2. '             an IP address, or Web address.
  3.  
  4. 'Usage
  5. 'Handle = WSAAsyncGetHostByNameAlias(Text1.hWnd, &H202, "www.intrstar.net")
  6.  
  7.  
  8. 'Public Function WSAAsyncGetHostByNameAlias(hWnd As Integer, wMsg As Integer, Host As String) As Long
  9.     Dim retIP As Long
  10.     retIP = inet_addr(Host)
  11.     If retIP = INADDR_NONE Then
  12.         retIP = WSAAsyncGetHostByName(hWnd, wMsg, Host, hostentbuffer, hostentasync_size)
  13.     Else
  14.         retIP = WSAAsyncGetHostByAddr(hWnd, wMsg, retIP, 4, AF_INET, hostentbuffer, hostentasync_size)
  15.     End If
  16.     WSAAsyncGetHostByNameAlias = retIP
  17. 'End Function